<%@page import="com.group.weekmgr.WeekDataBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%
	request.setCharacterEncoding("utf-8");
%>
<jsp:useBean id="weekDataBean" class="com.group.weekmgr.WeekDataBean"/>
<jsp:useBean id="weekDataMgr" class="com.group.weekmgr.WeekDataMgr"/>

<%
	String id = (String)session.getAttribute("idKey");
	weekDataBean.setId(id);
	String week_flag_p = request.getParameter("week_flag");
	System.out.println("week_flag_p" + week_flag_p);
	int week_flag = Integer.parseInt(week_flag_p);
	String[] work_code = request.getParameterValues("work_code");
	weekDataBean.setWork_code(work_code); 
	String[] sale_memo = request.getParameterValues("sale_memo");
	weekDataBean.setSale_memo(sale_memo);
	String[] activity_spec = request.getParameterValues("activity_spec");
	weekDataBean.setActivity_spec(activity_spec);
	String[] check_date = request.getParameterValues("check_date");
	weekDataBean.setCheck_date(check_date); 
	String[] target_date = request.getParameterValues("target_date");
	weekDataBean.setTarget_date(target_date);
	String[] target_ratio = request.getParameterValues("target_ratio");
	weekDataBean.setTarget_ratio(target_ratio); 
	String[] act_ratio = request.getParameterValues("act_ratio");
	weekDataBean.setAct_ratio(act_ratio); 
	
	boolean result = weekDataMgr.addMyWeekData(weekDataBean,week_flag); 
	System.out.println("result : " + result);
	if(result==true){
%>
	<script>
		alert("처리하였습니다.");
		history.back();
	</script>
<%
	}else{
%>
	<script>
		alert("오류 발생! 관리자에게 문의 바람");
		history.back();
	</script>
<%
	}
%>
